﻿@model App.Web.ViewModels.ProductViewModel
@using App.Web.Utility;
@using App.Core.Extensions;
@{
    System.Data.DataSet _TopViewedProducts = ViewData[AppConstants.ViewDataKeys.TOP_VIEWED_PRODUCTS] as System.Data.DataSet;   
	
    ViewBag.Title = Html.GetPageTitle("Product Details");    
}
@if (Model == null)
{
    <div class="GroupBox" style="margin-top:15px;">@Html.ErrorMessageBox("Sorry! requested product was not found.")</div>
}
else
{
    ViewBag.Title = Html.GetPageTitle(Model.Name);
    <div class="page-heading">
        <h1>@Model.Name</h1>
        <div>
            Detail product information for @Model.Name <br />
            @Html.Partial("_CategoryBreadCrumb", Model.CategoryID)
        </div>
    </div>
    <div class="GroupBox">        
        @*@if (Model.Model.IsNotNull())
        {
            <div class="caption">Model</div>
            <div>@Model.Model</div>
        }*@        
        <div style="clear:both"></div>
        <div class="caption">Details</div>
        <div class="long-text">@Model.Description</div>
        
        
        <div class="caption">Company</div>
        @*<div>@Html.PublicLink(Model.CompanyName, String.Format("Profile/{0}/{1}", Model.CompanyID,  Model.CompanyName.ToSeoUrl()), "Company")</div>*@
        <div><a href="/@Model.CompanyName.ToSeoUrl()">@Model.CompanyName</a></div>
        <div class="caption">Our Price</div>
        <div>@Model.Price</div>
        
        @if (Model.ProductImages != null && Model.ProductImages.Count > 0)
        {
            <div>
                <div class="imageRow">
  	                <div class="set">
                        @Html.GetProductImagesLightboxHtml(Model.ProductImages)
                    </div>
                </div>
            </div>
        }       
        
        @*Specification Section Starts Here*@
        @if (Model.CategoryZGL != null)
        {
            foreach (App.Web.ViewModels.ZGL.Category.ProductGroup group in Model.CategoryZGL.Group)
            {                       
            <div class="PropertyGroup">
                <div class="PropertyGroupTitle">
                    <div class="float-left">                        
                    @{
                String groupIcon = group.Icon.IsNullOrEmpty() ? "general.png" : group.Icon;
                groupIcon = String.Format("{0}/{1}", AppConstants.Directories.PRODUCT_PROPERTY_GROUP_ICONS, groupIcon);
                    }
                    <img class="ItemGroupIcon" src="@(groupIcon)" alt="" title="@group.Name" />
                    </div>
                    <div class="float-left ItemGroupTitle">@group.Name</div>
                    <div class="clear"></div>
                </div>
                <table cellpadding="3" cellspacing="0" style="width:70%;">
                    <colgroup>
                        <col style="width:30%;"/>
                        <col />
                    </colgroup>
                @foreach (App.Web.ViewModels.ZGL.Category.ProductGroupProperty property in group.Property)
                {
                    <tr>
                        <td>@property.Label</td>
                        <td>@property.Value.HtmlDecode()</td>
                    </tr>	        
                }
                </table>
            </div>
            }
        }
                <div id="fb-root"></div>
                        <script>
                            (function (d, s, id) {
                                var js, fjs = d.getElementsByTagName(s)[0];
                                if (d.getElementById(id)) return;
                                js = d.createElement(s); js.id = id;
                                js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=189852621074238";
                                fjs.parentNode.insertBefore(js, fjs);
                            } (document, 'script', 'facebook-jssdk'));
                         </script>
    
                <html xmlns:fb="http://ogp.me/ns/fb#"></html>
                <fb:like href="http://www.facebook.com/DeveloperTestBd" send="true" width="450" show_faces="true"></fb:like>
         <text>
        @section RightSideBar
        {    
            <div class="right-sidebar-container">
                <div style="border-bottom:#EFEFEF 1px solid; padding-bottom:2px; margin-bottom:10px;"><h2>Similar Product</h2></div>
                @Html.Partial("_ProductSidebarList", _TopViewedProducts)
            </div>
        }
        </text>

    </div>
    <text>
    @section PageHeadSection
    {        
        @Html.JavaScript("jquery-ui-1.8.18.custom.min.js", Url)
        @Html.JavaScript("jquery.smooth-scroll.min.js", Url)
        @Html.JavaScript("lightbox.js", Url)
    }
    </text>
} 
